import axios from 'axios'
import './request.js'

// 获取所有积分商品
export const GoodList = function () {
  return axios.get('/content/shop/list')
}
const headers = { 'content-Type': 'application/json' }
// 添加积分商品 传两个参数 一个实体shop和一个filedate图片
export const addGood = function (params) {
  return axios.post(`/content/shop/add/${params.name}/${params.price}/${params.remark}/${params.stock}`, params.filedata)
}

// 修改积分商品
export const updateGood = function (params) {
  return axios.put('/content/shop/update', params, { headers: headers })
}

// 修改积分商品状态
export const updateGoodStatus = function (params) {
  return axios.put(`/content/shop/status/${params.shopId}/${params.status}`)
}

// 删除积分商品
export const deleteGood = function (params) {
  return axios.delete(`/content/shop/delete/${params}`)
}
